home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Balloons.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  11.1 KB  |  288 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Balloons.p
  3.  
  4.      Contains:    Balloon Help Package Interfaces.
  5.  
  6.      Version:    Technology:    System 7.0
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1990-1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Balloons;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __BALLOONS__}
  28. {$SETC __BALLOONS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC BalloonsIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QUICKDRAW__}
  38. {$I Quickdraw.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MENUS__}
  41. {$I Menus.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __TEXTEDIT__}
  44. {$I TextEdit.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __ERRORS__}
  47. {$I Errors.p}
  48. {$ENDC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55.  
  56. {  • constants }
  57.  
  58.  
  59. CONST
  60.     kTopLeftTipPointsLeftVariant = 0;
  61.     kTopLeftTipPointsUpVariant    = 1;
  62.     kTopRightTipPointsUpVariant    = 2;
  63.     kTopRightTipPointsRightVariant = 3;
  64.     kBottomRightTipPointsRightVariant = 4;
  65.     kBottomRightTipPointsDownVariant = 5;
  66.     kBottomLeftTipPointsDownVariant = 6;
  67.     kBottomLeftTipPointsLeftVariant = 7;
  68.     kBalloonVariantCount        = 8;
  69.  
  70.  
  71. TYPE
  72.     BalloonVariant                        = SInt16;
  73.  
  74. CONST
  75.     hmBalloonHelpVersion        = $0002;                        {  The real version of the Help Manager  }
  76.     kHMHelpMenuID                = -16490;                        {  Resource ID and menu ID of help menu  }
  77.     kHMAboutHelpItem            = 1;                            {  help menu item number of About Balloon Help…  }
  78.     kHMShowBalloonsItem            = 3;                            {  help menu item number of Show/Hide Balloons  }
  79.     kHMHelpID                    = -5696;                        {  ID of various Help Mgr package resources (in Pack14 range)  }
  80.     kBalloonWDEFID                = 126;                            {  Resource ID of the WDEF proc used in standard balloons  }
  81.  
  82.                                                                 {  Dialog item template type constant  }
  83.     helpItem                    = 1;                            {  key value in DITL template that corresponds to the help item  }
  84.  
  85.                                                                 {  Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources  }
  86.     hmDefaultOptions            = 0;                            {  default options for help manager resources  }
  87.     hmUseSubID                    = 1;                            {  treat resID's in resources as subID's of driver base ID (for Desk Accessories)  }
  88.     hmAbsoluteCoords            = 2;                            {  ignore window port origin and treat rectangles as absolute coords (local to window)  }
  89.  
  90.     hmSaveBitsNoWindow            = 4;                            {  don't create a window, just blast bits on screen. No update event is generated  }
  91.     hmSaveBitsWindow            = 8;                            {  create a window, but restore bits behind window when window goes away & generate update event  }
  92.     hmMatchInTitle                = 16;                            {  for hwin resources, match string anywhere in window title string  }
  93.  
  94.                                                                 {  Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources  }
  95.     kHMStringItem                = 1;                            {  pstring used in resource  }
  96.     kHMPictItem                    = 2;                            {  'PICT' ResID used in resource  }
  97.     kHMStringResItem            = 3;                            {  'STR#' ResID & index used in resource  }
  98.     kHMTEResItem                = 6;                            {  Styled Text Edit ResID used in resource ('TEXT' & 'styl')  }
  99.     kHMSTRResItem                = 7;                            {  'STR ' ResID used in resource  }
  100.     kHMSkipItem                    = 256;                            {  don't display a balloon  }
  101.     kHMCompareItem                = 512;                            {  Compare pstring in menu item w/ PString in resource item ('hmnu' only)  }
  102.     kHMNamedResourceItem        = 1024;                            {  Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only)  }
  103.     kHMTrackCntlItem            = 2048;                            {  Reserved  }
  104.  
  105.                                                                 {  Constants for hmmHelpType's when filling out HMMessageRecord  }
  106.     khmmString                    = 1;                            {  help message contains a PString  }
  107.     khmmPict                    = 2;                            {  help message contains a resource ID to a 'PICT' resource  }
  108.     khmmStringRes                = 3;                            {  help message contains a res ID & index to a 'STR#' resource  }
  109.     khmmTEHandle                = 4;                            {  help message contains a Text Edit handle  }
  110.     khmmPictHandle                = 5;                            {  help message contains a Picture handle  }
  111.     khmmTERes                    = 6;                            {  help message contains a res ID to 'TEXT' & 'styl' resources  }
  112.     khmmSTRRes                    = 7;                            {  help message contains a res ID to a 'STR ' resource  }
  113.     kHMEnabledItem                = 0;                            {  item is enabled, but not checked or control value = 0  }
  114.  
  115.                                                                 {  ResTypes for Styled TE Handles in Resources  }
  116.     kHMTETextResType            = 'TEXT';                        {  Resource Type of text data for styled TE record w/o style info  }
  117.     kHMTEStyleResType            = 'styl';                        {  Resource Type of style information for styled TE record  }
  118.  
  119.     kHMDisabledItem                = 1;                            {  item is disabled, grayed in menus or disabled in dialogs  }
  120.     kHMCheckedItem                = 2;                            {  item is enabled, and checked or control value = 1  }
  121.     kHMOtherItem                = 3;                            {  item is enabled, and control value > 1  }
  122.                                                                 {  Method parameters to pass to HMShowBalloon  }
  123.     kHMRegularWindow            = 0;                            {  Create a regular window floating above all windows  }
  124.     kHMSaveBitsNoWindow            = 1;                            {  Just save the bits and draw (for MDEF calls)  }
  125.     kHMSaveBitsWindow            = 2;                            {  Regular window, save bits behind, AND generate update event  }
  126.  
  127.                                                                 {  Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages  }
  128.     kHMMenuResType                = 'hmnu';                        {  ResType of help resource for supporting menus  }
  129.     kHMDialogResType            = 'hdlg';                        {  ResType of help resource for supporting dialogs  }
  130.     kHMWindListResType            = 'hwin';                        {  ResType of help resource for supporting windows  }
  131.     kHMRectListResType            = 'hrct';                        {  ResType of help resource for rectangles in windows  }
  132.     kHMOverrideResType            = 'hovr';                        {  ResType of help resource for overriding system balloons  }
  133.     kHMFinderApplResType        = 'hfdr';                        {  ResType of help resource for custom balloon in Finder  }
  134.  
  135.  
  136. TYPE
  137.     HMStringResTypePtr = ^HMStringResType;
  138.     HMStringResType = RECORD
  139.         hmmResID:                INTEGER;
  140.         hmmIndex:                INTEGER;
  141.     END;
  142.  
  143.     HMMessageRecordPtr = ^HMMessageRecord;
  144.     HMMessageRecord = RECORD
  145.         hmmHelpType:            SInt16;
  146.         CASE INTEGER OF
  147.         0: (
  148.             hmmString:            Str255;
  149.             );
  150.         1: (
  151.             hmmPict:            SInt16;
  152.             );
  153.         2: (
  154.             hmmTEHandle:        TEHandle;
  155.             );
  156.         3: (
  157.             hmmStringRes:        HMStringResType;
  158.             );
  159.         4: (
  160.             hmmPictRes:            SInt16;
  161.             );
  162.         5: (
  163.             hmmPictHandle:        PicHandle;
  164.             );
  165.         6: (
  166.             hmmTERes:            SInt16;
  167.             );
  168.         7: (
  169.             hmmSTRRes:            SInt16;
  170.             );
  171.     END;
  172.  
  173.     HMMessageRecPtr                        = ^HMMessageRecord;
  174.     TipFunctionProcPtr = ProcPtr;  { FUNCTION TipFunction(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: BalloonVariant): OSErr; }
  175.  
  176.     TipFunctionUPP = UniversalProcPtr;
  177.  
  178. CONST
  179.     uppTipFunctionProcInfo = $00003FE0;
  180.  
  181. FUNCTION NewTipFunctionProc(userRoutine: TipFunctionProcPtr): TipFunctionUPP;
  182.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  183.     INLINE $2E9F;
  184.     {$ENDC}
  185.  
  186. FUNCTION CallTipFunctionProc(tip: Point; structure: RgnHandle; VAR r: Rect; VAR balloonVariant: BalloonVariant; userRoutine: TipFunctionUPP): OSErr;
  187.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  188.     INLINE $205F, $4E90;
  189.     {$ENDC}
  190. {  Public Interfaces  }
  191. FUNCTION HMGetHelpMenuHandle(VAR mh: MenuHandle): OSErr;
  192.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  193.     INLINE $303C, $0200, $A830;
  194.     {$ENDC}
  195. FUNCTION HMShowBalloon({CONST}VAR inHelpMessage: HMMessageRecord; inTip: Point; VAR inHotRect: Rect; inTipProc: TipFunctionUPP; inWindowProcID: SInt16; inBalloonVariant: BalloonVariant; inMethod: SInt16): OSErr;
  196.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  197.     INLINE $303C, $0B01, $A830;
  198.     {$ENDC}
  199. FUNCTION HMShowMenuBalloon(itemNum: SInt16; itemMenuID: SInt16; itemFlags: SInt32; itemReserved: SInt32; tip: Point; alternateRect: RectPtr; tipProc: TipFunctionUPP; theProc: SInt16; balloonVariant: BalloonVariant): OSErr;
  200.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  201.     INLINE $303C, $0E05, $A830;
  202.     {$ENDC}
  203. FUNCTION HMRemoveBalloon: OSErr;
  204.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  205.     INLINE $303C, $0002, $A830;
  206.     {$ENDC}
  207. FUNCTION HMGetIndHelpMsg(inWhichResType: ResType; inWhichResID: SInt16; inMessageIndex: SInt16; inMessageState: SInt16; VAR outOptions: UInt32; VAR outTip: Point; VAR outHotRect: Rect; VAR outWindowProcID: SInt16; VAR outBalloonVariant: BalloonVariant; VAR outHelpMessage: HMMessageRecord; VAR outMessageCount: SInt16): OSErr;
  208.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  209.     INLINE $303C, $1306, $A830;
  210.     {$ENDC}
  211. FUNCTION HMIsBalloon: BOOLEAN;
  212.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  213.     INLINE $303C, $0007, $A830;
  214.     {$ENDC}
  215. FUNCTION HMGetBalloons: BOOLEAN;
  216.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  217.     INLINE $303C, $0003, $A830;
  218.     {$ENDC}
  219. FUNCTION HMSetBalloons(flag: BOOLEAN): OSErr;
  220.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  221.     INLINE $303C, $0104, $A830;
  222.     {$ENDC}
  223. FUNCTION HMSetFont(font: SInt16): OSErr;
  224.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  225.     INLINE $303C, $0108, $A830;
  226.     {$ENDC}
  227. FUNCTION HMSetFontSize(fontSize: UInt16): OSErr;
  228.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  229.     INLINE $303C, $0109, $A830;
  230.     {$ENDC}
  231. FUNCTION HMGetFont(VAR font: SInt16): OSErr;
  232.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  233.     INLINE $303C, $020A, $A830;
  234.     {$ENDC}
  235. FUNCTION HMGetFontSize(VAR fontSize: UInt16): OSErr;
  236.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  237.     INLINE $303C, $020B, $A830;
  238.     {$ENDC}
  239. FUNCTION HMSetDialogResID(resID: SInt16): OSErr;
  240.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  241.     INLINE $303C, $010C, $A830;
  242.     {$ENDC}
  243. FUNCTION HMSetMenuResID(menuID: SInt16; resID: SInt16): OSErr;
  244.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  245.     INLINE $303C, $020D, $A830;
  246.     {$ENDC}
  247. FUNCTION HMBalloonRect({CONST}VAR inMessage: HMMessageRecord; VAR outRect: Rect): OSErr;
  248.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  249.     INLINE $303C, $040E, $A830;
  250.     {$ENDC}
  251. FUNCTION HMBalloonPict({CONST}VAR inMessage: HMMessageRecord; VAR outPict: PicHandle): OSErr;
  252.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  253.     INLINE $303C, $040F, $A830;
  254.     {$ENDC}
  255. FUNCTION HMScanTemplateItems(whichID: SInt16; whichResFile: SInt16; whichType: ResType): OSErr;
  256.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  257.     INLINE $303C, $0410, $A830;
  258.     {$ENDC}
  259. FUNCTION HMExtractHelpMsg(inType: ResType; inResID: SInt16; inMessageIndex: SInt16; inMessageState: SInt16; VAR outMessage: HMMessageRecord): OSErr;
  260.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  261.     INLINE $303C, $0711, $A830;
  262.     {$ENDC}
  263. FUNCTION HMGetDialogResID(VAR resID: SInt16): OSErr;
  264.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  265.     INLINE $303C, $0213, $A830;
  266.     {$ENDC}
  267. FUNCTION HMGetMenuResID(menuID: SInt16; VAR resID: SInt16): OSErr;
  268.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  269.     INLINE $303C, $0314, $A830;
  270.     {$ENDC}
  271. FUNCTION HMGetBalloonWindow(VAR window: WindowPtr): OSErr;
  272.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  273.     INLINE $303C, $0215, $A830;
  274.     {$ENDC}
  275.  
  276.  
  277.  
  278. {$ALIGN RESET}
  279. {$POP}
  280.  
  281. {$SETC UsingIncludes := BalloonsIncludes}
  282.  
  283. {$ENDC} {__BALLOONS__}
  284.  
  285. {$IFC NOT UsingIncludes}
  286.  END.
  287. {$ENDC}
  288.